import { request } from '@/utils/request.js'

/**
 * 地址详情 API JS
 */

export default {

  /**
   * 获取地址详情分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'logistics/addressLibDetail/index',
      method: 'get',
      params
    })
  },
  getAllList (params = {}) {
    return request({
      url: 'logistics/addressLibDetail/userlist',
      method: 'get',
      params
    })
  },
  
  /**
   * 添加地址详情
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'logistics/addressLibDetail/save',
      method: 'post',
      data
    })
  },

  WaybillSeaClose (data = {}) {
    return request({
      url: 'logistics/addressLibDetail/WaybillSeaClose',
      method: 'post',
      data
    })
  },

  /**
   * 更新地址详情数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'logistics/addressLibDetail/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取地址详情
   * @returns
   */
  read (id) {
    return request({
      url: 'logistics/addressLibDetail/read/' + id,
      method: 'get',
      data
    })
  },

  /**
   * 将地址详情删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'logistics/addressLibDetail/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 恢复地址详情数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'logistics/addressLibDetail/recovery',
      method: 'put',
      data
    })
  },
  /**
   * 恢复地址详情数据
   * @returns
   */
  recycle (data) {
    return request({
      url: 'logistics/addressLibDetail/recycle',
      method: 'get',
      data
    })
  },

}